//销售得到Bom小计价格
function getBomPriceSubTotal(row){
    //用量
    var cnt=row.useCnt;
    //估价
    var price=row.thingPrice;
     return cnt*price;
}


//销售得到Bom总计价格
function getBomTotal(rows){
    alert(rows);
    alert(rows.rows[0].id);
    var sum=0;
    for(var i in rows){
        var row=rows[i];
        var subTotal=row.subTotal;
        alert(subTotal)
        sum+=subTotal;
    }
    return sum;
}

//生成订单id
function getRanOrderId(purGroup) {
    var date = new Date();
    var fullYear = date.getFullYear();
    var month = date.getMonth()+1;
    var day = date.getDate();
    fullYear=fullYear.toString().substring(2);
    if(month.toString().length==1){
        month="0"+month;
    }
    if(day.toString().length==1){
        day="0"+day;
    }
    if(purGroup.toString().length==1){
        purGroup="0"+purGroup;
    }
    return fullYear+""+month+day+purGroup;
}


//生成简单订单id
function getSimpleRanOrderId() {
    var s = Math.random().toString().substring(3,12);
    return s;
}